//
//  GMPackageThrCell.m
//  Teecloud
//
//  Created by 小熊 on 2018/10/29.
//  Copyright © 2018年 小志. All rights reserved.
//

#import "GMPackageThrCell.h"
@interface GMPackageThrCell()
@property (weak, nonatomic) IBOutlet UILabel *titleName;
@property (weak, nonatomic) IBOutlet UIButton *biaoqian;
@property (weak, nonatomic) IBOutlet UILabel *leftLab;
@property (weak, nonatomic) IBOutlet UILabel *rightLab;

@end
@implementation GMPackageThrCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.biaoqian.layer.borderWidth =1.0;
    self.biaoqian.layer.borderColor =[UIColor colorWithHexString:@"FF8D00"].CGColor;
    self.biaoqian.layer.cornerRadius=5;
}

-(void)setModel:(GMDirDatasModel *)model{
    _model = model;
    self.titleName.text = model.Name;
    [self.biaoqian setTitle:[NSString stringWithFormat:@"  %@  ",model.ResTypeName] forState:UIControlStateNormal];
    self.leftLab.text = model.FromName;
    if ([model.ResType isEqualToNumber:@(1)]) {
        /**视频*/
        NSString *perStr = [NSString stringWithFormat:@"%@%%",model.Percent];
        NSString *desStr = [NSString stringWithFormat:@"%@分钟  %@",model.TimeLen,perStr];
        self.rightLab.attributedText = [NSMutableAttributedString String:desStr RangeString:perStr];
    }else if ([model.ResType isEqualToNumber:@(2)]){
        /**文档*/
        NSString *perStr = [NSString stringWithFormat:@"%@%%",model.Percent];
        NSString *desStr = [NSString stringWithFormat:@"%@页  %@",model.PageCount,perStr];
        self.rightLab.attributedText = [NSMutableAttributedString String:desStr RangeString:perStr];
    }
}
@end
